package com.stream;

import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class StreamDemo2 {
	public static void main(String[] args) {
		List<Object> list = Arrays.asList();
		//集合创建
		list.stream();
		list.parallelStream();
		//数组创建
		Arrays.stream(new int[]{2,3,4});
		//创建数字
		IntStream.of(1,2,3);
//		IntStream.rangeClosed(96, 100).limit(10).forEach(System.out::println);
		
		int sum = IntStream.range(10, 14).sum();
		System.out.println(sum);
		//Random创建
		new Random().ints().limit(10);
		
		Random rnd = new Random();
		Stream.generate(()->rnd.nextInt()).limit(20);
	}
}
